<?php

class AbstractFactory
{

  /**
   *
   * @param IDomObjDefinition $def
   * @param array $data
   * @param int $depth
   * @return IDomObj
   */
  public static function factory(IDomObjDefinition $def, $data, $depth = -1)
  {
    $obj = DomainMapper::inflateObj($def, $data, $depth);
    return $obj;
  }

  /**
   *
   * @param IDomObjDefinition $def
   * @param array $data
   * @param int $depth
   * @return array
   */
  public static function factoryCollection(IDomObjDefinition $def, $data, $depth = -1)
  {
    $objs = DomainMapper::inflateCollection($def, $data, $depth);
    return $objs;
  }

}

?>